import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/tenant',
    method: 'GET',
    params: query
  })
}

export function fetchAll() {
  return request({
    url: '/tenant',
    method: 'GET'
  })
}

export function getTenant(id) {
  return request({
    url: `/tenant/${id}`,
    method: 'GET'
  })
}

export function saveTenant(data) {
  return request({
    url: '/tenant',
    method: 'POST',
    data
  })
}

export function batchDelete(data) {
  return request({
    url: '/tenant/BatchDelete',
    method: 'POST',
    data
  })
}

export function deleteTenant(id) {
  return request({
    url: `/tenant/${id}`,
    method: 'DELETE'
  })
}

export function updateTenant(data) {
  return request({
    url: `/tenant/${data.Id}`,
    method: 'PUT',
    data
  })
}
